package com.reason.user;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import com.reason.user.config.TokenDecode;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;

/**
 * @author  yulongjun
 * @date 2020/6/29 10:42 下午
 */
@SpringBootApplication
@MapperScan("com.reason.user.dao")
//nacos客户端
@EnableDiscoveryClient 
public class UserApplication {
    public static void main(String[] args) {
        SpringApplication.run(UserApplication.class,args);
    }

    /**
     * 解析令牌的类
     * @return TokenDecode对象
     */
    @Bean
    public TokenDecode getTokenDecode(){
        return new TokenDecode();
    }

    /**
     * 分页插件
     * @return PaginationInterceptor对象
     */
    @Bean
    public PaginationInterceptor paginationInterceptor(){
        return new PaginationInterceptor();
    }
}
